﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using OAclient.Common;

namespace OAclient.Models
{
    public class ConfigModel
    {
        //public String ProviderName = ComVariable.ProviderName;
        private List<SelectListItem> emailProvider;

        public List<SelectListItem> EmailProvider
        {
            get
            {
                return emailProvider;
            }
        }

        //public String ReadedName = ComVariable.ReadedName;
        private List<SelectListItem> emailReaded;

        public List<SelectListItem> EmailReaded
        {
            get
            {
                return emailReaded;
            }
        }

        //public String LastDayName = ComVariable.LastDayName;
        private List<SelectListItem> emailLastDay;
        public List<SelectListItem> EmailLastDay
        {
            get
            {
                return emailLastDay;
            }
        }

        public readonly String curr_Provider;

        public readonly String curr_Readed;

        public readonly String curr_Lastday;


        public ConfigModel(String emailProvider, String emailReaded, String emailLastDay)
        {
            this.setProviderList();
            this.setReaded();
            this.setLastDay();

            this.curr_Provider = emailProvider;
            this.curr_Readed = emailReaded;
            this.curr_Lastday = emailLastDay;
        }

        private void setProviderList()
        {
            emailProvider = new List<SelectListItem>();
            emailProvider.Add(new SelectListItem
            {
                Text = "网易",
                Value = "163"
            });
            emailProvider.Add(new SelectListItem
            {
                Text = "腾讯",
                Value = "QQ"
            });
            emailProvider.Add(new SelectListItem
            {
                Text = "谷歌",
                Value = "google"
            });
        }

        private void setReaded()
        {
            emailReaded = new List<SelectListItem>();
            emailReaded.Add(new SelectListItem
            {
                Text = "True",
                Value = "True"
            });
            emailReaded.Add(new SelectListItem
            {
                Text = "False",
                Value = "False"
            });
        }

        private void setLastDay()
        {
            emailLastDay = new List<SelectListItem>();
            emailLastDay.Add(new SelectListItem
            {
                Text = "一星期",
                Value = "7"
            });
            emailLastDay.Add(new SelectListItem
            {
                Text = "三星期",
                Value = "21"
            });
            emailLastDay.Add(new SelectListItem
            {
                Text = "一个月",
                Value = "30"
            });
            emailLastDay.Add(new SelectListItem
            {
                Text = "两个月",
                Value = "60"
            });
            emailLastDay.Add(new SelectListItem
            {
                Text = "三个月",
                Value = "90"
            });
        }
    }
}
